package com.example.sell.utils;

/**
 * @author: vince_zww
 * @date: 2020/8/25 18:40
 * @desceription: 数值比较
 */
public class MathUtil {

    private static final Double MENEY_RANGE = 0.01;

    /**
     * 比较2个金额是否相等，精度0.01
     * @param d1
     * @param d2
     * @return
     */
    public static Boolean equals(Double d1,Double d2){
        Double resule = Math.abs(d1 - d2);
        if (resule<MENEY_RANGE){
            return true;
        }else {
            return false;
        }
    }

}
